package chapter67;

import java.util.Scanner;

public class Human { //定义人类
	public String name; //姓名
	public String gender; //性别
	public int age; //年龄
	
	public Human(){
		this.name = "韩冰";
	}
	
	public Human(String name){
		this.name = name;
	}
	// 工作的行为
	public void work(){
		System.out.println(this.name+"的工作理念：干活挣钱有饭吃！");
	}
	
	public void work(String contect){
		int age = this.age;
		System.out.println(this.name+"的工作理念是："+contect);
	}
	
	public String work1(){
		return "实现自身价值和理想!";
	}
	
	public static void main(String[] args) {
		Human person = new Human();
		person.name = "韩冰";
		person.gender = "女";
		person.age = 22;
		person.work();
		System.out.println("\n");
		person.work("干活挣钱有饭吃！");
		String contect = person.work1();
		System.out.println("\n");
		System.out.println(person.name+"的工作理念："+contect);
		System.out.println("\n");
		
		System.out.println("大家好，欢迎'"+person.name+"'来到地球村");
		Scanner input = new Scanner(System.in);
		System.out.println("请选择你的性别：(1、男2、女)");
		switch(input.nextInt()){
		case 1:
			person.gender = "男";
			break;
		case 2:
			person.gender = "女";
			break;
		default:
			System.out.println("操作错误");
			return;
		}
		System.out.println("请输入你的年龄：");
		person.age = input.nextInt();
		person.work();
		System.out.println("请重新输入你的工作理念：");
		String contect1 = input.next();
		person.work(contect1);
		System.out.println("***************************");
	}

}
